package com.oc.claimobs.bb.model;

import java.io.IOException;

import ar.com.lemil.j2me.serialization.IObjectInputStream;

import com.oc.utils.TextUtils;

public class Reclamo extends SerializableBase {

	private String calle = "";
	private String alturaCalle= "";

	private String latlong = "";
	private String imagetk = "";
	//private String imagePath = "";
	private String reclamoid = "";
	private String reclamoTipo = "";

	public String getCalle() {
		return calle;
	}

	public void setCalle(String calle) {
		this.calle = calle;
	}

	public String getAlturaCalle() {
		return alturaCalle;
	}

	public void setAlturaCalle(String alturaCalle) {
		this.alturaCalle = alturaCalle;
	}

	//public String getImagePath() {
	//	return imagePath;
	//}

	//public void setImagePath(String imagePath) {
	//	this.imagePath = imagePath;
	//}

	public String getLatlong() {
		return latlong;
	}

	public void setLatlong(String latlong) {
		this.latlong = latlong;
	}

	public String getImagetk() {
		return imagetk;
	}

	public void setImagetk(String imagetk) {
		this.imagetk = imagetk;
	}

	public String getReclamoid() {
		return reclamoid;
	}

	public void setReclamoid(String reclamoid) {
		this.reclamoid = reclamoid;
	}

	public String getReclamoTipo() {
		return reclamoTipo;
	}

	public void setReclamoTipo(String reclamoTipo) {
		this.reclamoTipo = reclamoTipo;
	}

	public String toString() {
		StringBuffer s = new StringBuffer();
		s.append("alturaCalle=");
		s.append(this.alturaCalle);
		s.append("&calle=");
		s.append(this.calle);
		//s.append("&imagePath=");
		//s.append(this.imagePath);
		s.append("&imagetk=");
		s.append(this.imagetk);
		s.append("&latlong=");
		s.append(this.latlong);
		s.append("&reclamoid=");
		s.append(this.reclamoid);
		s.append("&reclamoTipo=");
		s.append(this.reclamoTipo);
		return s.toString();
	}



	public void readObject(IObjectInputStream iobjectinputstream)
			throws IOException, ClassNotFoundException {
		String data = iobjectinputstream.readASC();
		String[] pieces = TextUtils.split(data, "&");

		for (int i = 0; i < pieces.length; i++) {
			String[] s = TextUtils.split(pieces[i], "=");
			if (s.length > 1) {
				String k = s[0];
				String v = pieces[i].substring(k.length()+1);
				if (k.equalsIgnoreCase("alturaCalle")) {
					setAlturaCalle(v);
				}
				if (k.equalsIgnoreCase("calle")) {
					setCalle(v);
				}
				//if (k.equalsIgnoreCase("imagePath")) {
				//	setImagePath(v);
				//}
				if (k.equalsIgnoreCase("imagetk")) {
					setImagetk(v);
				}
				if (k.equalsIgnoreCase("latlong")) {
					setLatlong(v);
				}
				if (k.equalsIgnoreCase("reclamoid")) {
					setReclamoid(v);
				}
				if (k.equalsIgnoreCase("reclamoTipo")) {
					setReclamoTipo(v);
				}
			}
		}
		
	}
}
